package com.mingqijia.gassafety.db.mapper;

import com.alibaba.fastjson.JSONArray;
import com.mingqijia.gassafety.db.entity.HistoryAlarm;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mingqijia.gassafety.db.entity.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 报警器设备报警记录 Mapper 接口
 * </p>
 *
 * @author wanghai
 * @since 2022-08-08
 */
@Mapper
@Repository
public interface HistoryAlarmMapper extends BaseMapper<HistoryAlarm> {

    List<HistoryAlarmVo> getAlarmList(LatestLogListVO vo);

    List<HistoryAlarmVo> getRecordWithType1(LatestLogListVO vo);

    List<HistoryAlarmVo> getRecordWithType2(LatestLogListVO vo);


    List<HangzhouHistoryAlarmVo> hzGetRecordWithType1(LatestLogListVO vo);

    List<HangzhouHistoryAlarmVo> hzGetRecordWithType2(LatestLogListVO vo);

    List<HistoryAlarm> selectListNowDay(String hangzhouSpId);

    //查询最近两小时的最新数据
    List<HistoryAlarm> selectListTwoHours(String hangzhouSpId);

    List<HistoryAlarmVo> getVccRecord(LatestLogListVO vo);

    List<HistoryAlarmVo> getAlarmRecord();

    // 查询当天的记录 并过滤掉调试，测试，检测，检定，标定等数据 并且 安装时间开始民用2天 工商7天内的报警不计算    民用-EquipmentType.HOME_GAS_DETECTOR 其他-工商业
    List<PlatformAlarmEquipmentResp> getTodayAlarmCount(@Param("spIds") List<String> spIds);

    List<HistoryAlarmVo> getAsstRecord(LatestLogListVO vo);

    GetCondtionListVo getConditionList(@Param("spIds") List<String> spIds, @Param("funcCodes") List<String> funcCodes);

    List<HistoryAlarmVo> warningInfoGas(IndustryScreenWarningVo vo);

    // 查询当天的前10条记录 并过滤掉调试，测试，检测，检定，标定等数据 并且 安装时间开始民用2天 工商7天内的报警不计算    民用-EquipmentType.HOME_GAS_DETECTOR 其他-工商业
    List<HistoryAlarm> queryAlarm(@Param("spIds") List<String> spIds);

    List<HistoryAlarmVo> industryAlarmRecord(LatestLogListVO vo);

    //根据客户id进行查询
    List<HistoryAlarm> selectByCustomerId(Integer customerId);
}
